package com.woniuxy03;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-05-23 15:14
 */
public class Test18 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个数");
        int num = sc.nextInt();
        int i;
        //true是质数，false不是质数
        boolean flag = true;
        for(i=2;i<num;i++){
            if(num%i==0){
                flag = false;
                break;
            }
        }
        //13  2-12
        if (i==num) {
            System.out.println("是质数");
        }else{
            System.out.println("不是质数");
        }
        if (flag) {
            System.out.println("是质数");
        }else{
            System.out.println("不是质数");
        }

    }
}
